//
//  CYGHomeRcmdHeaderView.m
//  CYGHuntForCity
//
//  Created by cygarm on 16/2/29.
//  Copyright © 2016年 cygarm. All rights reserved.
//

#import "CYGHomeRcmdHeaderView.h"
#import "UIColor+CYGColor.h"

@interface CYGHomeRcmdHeaderView ()

// 分类名
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
// 数量
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;

@end

@implementation CYGHomeRcmdHeaderView

- (void)awakeFromNib {
	
}

+ (instancetype)headViewWithHomeModel:(CYGHomeViewModel *)homeModel {
	CYGHomeRcmdHeaderView *headView = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
	
	headView.homeModel = homeModel;
	
	return headView;
}

- (void)setHomeModel:(CYGHomeViewModel *)homeModel {
	_homeModel = homeModel;
	
	self.backgroundView = [[UIView alloc] initWithFrame:self.bounds];
	self.backgroundView.backgroundColor = [UIColor colorWithHexString:homeModel.color alpha:1.0];
	self.titleLabel.text = homeModel.tag_name;
	self.subTitleLabel.text = homeModel.section_count;
}

@end
